{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1mface() output: [[0, 1, 2], [2, 1, 3], [1, 0, 3]]\u001b[0m\n",
      "\u001b[1mgetPoints() output:\n",
      " [[50 50 50]\n",
      " [70 40 50]\n",
      " [50 40 80]\n",
      " [80 70 50]]\u001b[0m\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "13fb933ae9c04f23a0353670fcf5ab50",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Viewer(cmap='jet', geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_point…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"Manually build a mesh.\"\"\"\n",
    "\n",
    "from vtkplotter import *\n",
    "\n",
    "embedWindow('itkwidgets') # or k3d\n",
    "\n",
    "verts = [(50,50,50), (70,40,50), (50,40,80), (80,70,50)]\n",
    "faces = [(0,1,2), (2,1,3), (1,0,3)]\n",
    "# (the first triangle face is formed by vertex 0, 1 and 2)\n",
    "\n",
    "a = Actor([verts, faces])\n",
    "\n",
    "# the way vertices are assembled into polygons can be retrieved\n",
    "# in two different formats:\n",
    "printc('face() output:',   a.faces())\n",
    "printc('getPoints() output:\\n', a.getPoints())\n",
    "\n",
    "a.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
